#!/bin/bsah
if [ -n "$1" ] ; then
  data_str=$1
else
  data_str=`date -d "-1 days" +%F`
fi

sqoop import \
--connect  jdbc:mysql://node101:3306/jtp_app_shujuku      \
--username root      \
--password 123456   \
--fields-terminated-by '\001'    \
--query 'SELECT *FROM  t_md_areas WHERE $CONDITIONS AND 1=1 ;' \
--delete-target-dir \
--num-mappers 1 \
--target-dir hdfs://node101:8020/warehouse/app_basic/t_md_areas/${data_str} \
--input-null-string '\\N' \
--input-null-non-string '\\N'